package com.baby.work.controller;

import com.baby.work.domain.operator.IOperator;
import com.baby.work.domain.operator.MobileOperator;
import com.baby.work.domain.operator.TelecomOperator;
import com.baby.work.domain.operator.UnicomOperator;
import com.baby.work.dto.ChargeInfo;
import com.baby.work.service.ChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("change")
public class ChargeController {

    @Autowired
    ChargeService chargeService;


    // http://localhost:8090/change/do?min=200&flow=5
    @GetMapping("/do")
    public ArrayList<ChargeInfo> charge(@RequestParam(value = "min") int min, @RequestParam(value = "flow") int flow) {
        return chargeService.charge(min, flow);
    }

}
